package com.cj.designpattern.proxy.staticstate;

import com.cj.designpattern.proxy.IUserDAO;
import com.cj.designpattern.proxy.UserDAOImpl;

/**
 * ClassName: UserDaoProxy <br/>
 * Function: 用户DAO代理类 <br/>
 * date: 2018/04/27 15:02 <br/>
 *
 * @author chenj
 * @version 1.0.0
 * @since JDK 1.8
 */
public class UserDaoProxy implements IUserDAO {

    private UserDAOImpl userDAO;

    public UserDaoProxy(UserDAOImpl userDAO) {
        this.userDAO = userDAO;
    }

    @Override
    public void save() {
        System.out.println("开始保存用户数据...");
        userDAO.save();
        System.out.println("保存用户数据成功！");
    }
}
